package demo.singleton;

/**
 * @ClassName EnumStavingSingleton
 * @Description
 * @Author 47980
 * @Date 2020/6/14 9:38
 * @Version V_1.0
 **/
public class EnumStavingSingleton {
    private EnumStavingSingleton(){}
    public static EnumStavingSingleton getInstance() {
        return ContainerHolder.HOLDER.instance;
    }

    private enum ContainerHolder{
        HOLDER;
        private EnumStavingSingleton instance;
        ContainerHolder() {
            instance = new EnumStavingSingleton();
        }
    }
}
